﻿@model GPS.ENTITYS.CrudModelITHHOCVIEN

@{
    ViewBag.Title = "Chi Tiết Học Viên";
}
<style type="text/css">
    .btn-file {
        position: relative;
        overflow: hidden;
    }

        .btn-file input[type=file] {
            position: absolute;
            top: 0;
            right: 0;
            min-width: 100%;
            min-height: 100%;
            font-size: 100px;
            text-align: right;
            filter: alpha(opacity=0);
            opacity: 0;
            background: red;
            cursor: inherit;
            display: block;
        }

    input[readonly] {
        background-color: white !important;
        cursor: text !important;
    }
</style>
<div class="modal-header fdb-panel-header-10">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h5 class="modal-title" id="myModalLabel">Thông Tin Học Viên</h5>
</div>
@using (Html.BeginForm("Detail", "GPS_HocVien", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    <div id="tabs">
        <div id="tabs-1">
            @Html.Hidden("IsEdit", 0)
            <div class="row">
                <fieldset class="fs_body">
                    <legend class="head_title">Thông tin học viên</legend>
                    <div class="col-lg-8">
                        <div class="row margin-top-05">
                            <div class="col-md-4 bg-primary text-white control-label">
                                Họ và tên:
                            </div>
                            <div class="col-md-8">
                                @Html.DisplayFor(model => model.HV_HOTEN, new { @class = "form-control", @readonly = "readonly" })
                            </div>
                        </div>

                        <div class="row margin-top-05">
                            <div class="col-md-4 control-label">
                                Ngày sinh:
                            </div>
                            <div class="col-md-8">
                                @Html.DisplayFor(model => model.HV_NGAYSINH, "{0:dd/MM/yyyy}", new { @class = "form-control", @readonly = "readonly" })
                            </div>
                        </div>

                        <div class="row margin-top-05">
                            <div class="col-md-4 control-label">
                                Giới tính:
                            </div>
                            <div class="col-md-8">
                                @Html.DisplayFor(model => model.HV_GIOITINH, new { @class = "form-control", @readonly = "readonly" })
                            </div>
                        </div>

                        <div class="row margin-top-05">
                            <div class="col-md-4 control-label">
                                Số CMTDN/HC:
                            </div>
                            <div class="col-md-8">
                                @Html.DisplayFor(model => model.HV_SOCMT, new { @class = "form-control", @readonly = "readonly" })
                            </div>
                        </div>

                        <div class="row margin-top-05">
                            <div class="col-md-4 control-label">
                                Quốc tịch:
                            </div>
                            <div class="col-md-8">
                                @Html.DisplayFor(model => model.HV_QUOCTICH_MA, new { @class = "form-control", @readonly = "readonly" })
                            </div>
                        </div>

                        <div class="row margin-top-05">
                            <div class="col-md-4 control-label">
                                Nơi thường trú:
                            </div>
                            <div class="col-md-8">
                                @Html.DisplayFor(model => model.HV_NOITT, new { @class = "form-control", @readonly = "readonly" })
                            </div>
                        </div>

                        <div class="row margin-top-05">
                            <div class="col-md-4 control-label">
                                Nơi cư trú:
                            </div>
                            <div class="col-md-8">
                                @Html.DisplayFor(model => model.HV_NOICT, new { @class = "form-control", @readonly = "readonly" })
                            </div>
                        </div>

                    </div>

                    @*<div class="col-lg-4">
                        <fieldset class="fs_body">
                            <legend class="head_title">Ảnh Đại Diện</legend>
                            <div style="margin: 10px auto; text-align:center;">
                                @{
    String img64Url = string.Empty;
    if (Model.HV_HS_ANH != null)
    {
        String img64 = Convert.ToBase64String(Model.HV_HS_ANH);
        img64Url = string.Format("data:image/" + Model.HV_HS_ANH + ";base64,{0}", img64);
    }

                                }
                                <img id="output_image" src="@img64Url" width="100" height="120" />
                            </div>
                        </fieldset>
                    </div>*@
                </fieldset>
            </div>

            <div class="row">
                <fieldset class="fs_body">
                    <legend class="head_title">Thôngtin hồ sơ</legend>

                    <div class="row margin-top-05">
                        <div class="col-md-2 control-label text-left">
                            Đơn vị nhận HS:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_DVGTVT_MA_NHANHS, new { @class = "form-control", @readonly = "readonly" })
                        </div>

                    </div>

                    <div class="row margin-top-05">
                        <div class="col-md-2 control-label">
                            Cơ sở đào tạo:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_DVGTVT_MA, new { @class = "form-control", @readonly = "readonly" })
                        </div>
                    </div>

                    <div class="row margin-top-05">
                        <div class="col-md-2 control-label">
                            Mã đăng ký:
                        </div>
                        <div class="col-md-4">
                            @*@Html.DisplayFor(model => model., new { @class = "form-control", @readonly = "readonly" })*@
                        </div>

                        <div class="col-md-2 control-label">
                            Số hồ sơ:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_SOHOSO, new { @class = "form-control", @readonly = "readonly" })
                        </div>
                    </div>

                    <div class="row margin-top-05">
                        <div class="col-md-2 control-label">
                            Mã khóa học:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_KH_MA, new { @class = "form-control", @readonly = "readonly" })
                        </div>

                        <div class="col-md-2 control-label">
                            Hạng đào tạo:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HANGDT_MA, new { @class = "form-control", @readonly = "readonly" })
                        </div>
                    </div>

                    <div class="row margin-top-05">
                        <div class="col-md-2 control-label">
                            Trạng thái xử lý:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_TTXL_MA, new { @class = "form-control", @readonly = "readonly" })
                        </div>
                    </div>

                    @*<div class="row margin-top-05">
                            <div class="col-md-2 control-label">
                                Trạng Thái<span style="color:red;">(*)</span>
                            </div>
                            <div class="col-md-4">
                                @Html.CheckBoxFor(model => model.HV_ACTIVE, new { @class = "checkbox", @readonly = "readonly" })
                            </div>
                        </div>*@

                    @*<div class="row margin-top-05">
                            <div class="col-md-2 control-label">
                                Mô Tả
                            </div>
                            <div class="col-md-4">
                                @Html.TextAreaFor(model => model.HV_MOTA, new { @class = "form-control", @rows = 5, @readonly = "readonly" })
                            </div>
                        </div>*@
                </fieldset>
            </div>

            <div class="row">
                <fieldset class="fs_body">
                    <legend class="head_title">Thông tin GPLX</legend>
                    <div class="row margin-top-05">
                        <div class="col-md-2 control-label">
                            Số GPLX:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_SOGPLXDACO, new { @class = "form-control", @readonly = "readonly" })
                        </div>

                        <div class="col-md-2 control-label">
                            Hạng GPLX:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_HANGGPLXDACO, new { @class = "form-control", @id = "HV_NOICT_DVHC_MA", @readonly = "readonly" })
                        </div>
                    </div>

                    <div class="row margin-top-05">
                        <div class="col-md-2 control-label">
                            Hình thức cấp:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_MAHTCAP, new { @class = "form-control", @readonly = "readonly" })
                        </div>
                    </div>

                    <div class="row margin-top-05">
                        <div class="col-md-2 control-label">
                            Nơi cấp:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_NOICAPGPLXDACO, new { @class = "form-control", @readonly = "readonly" })
                        </div>

                        <div class="col-md-2 control-label">
                            Ngày cấp:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_NGAYCAPGPLXDACO, new { @class = "form-control", @readonly = "readonly" })
                        </div>
                    </div>

                    <div class="row margin-top-05">
                        <div class="col-md-2 control-label">
                            Ngày in:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_NGAYINGIAYTN, new { @class = "form-control", @readonly = "readonly" })
                        </div>
                        @*<div class="col-md-2 control-label">
                            Ngày trả:
                        </div>
                        <div class="col-md-4">
                            @Html.DisplayFor(model => model.HV_HS_NGAYHENTRA, new { @class = "form-control", @readonly = "readonly" })
                        </div>*@
                    </div>
                </fieldset>
            </div>
            <div class="row Action_FormDetail">
                <a href="@Url.Action("ExportWord", "GPS_HocVien", new { id = Model.HV_MA, id1=Model.HV_DVGTVT_MA })" class="btn btn-primary btn-sm">
                    <i class="fa fa-file-excel-o"></i> In chi tiết học viên
                </a>
                <a href="@Url.Action("ExportWordHopDong", "GPS_HocVien", new { id = Model.HV_MA, id1 = Model.HV_DVGTVT_MA, id2 = Model.STT_ORDER_KH })" class="btn btn-primary btn-sm">
                    <i class="fa fa-file-excel-o"></i> In hợp đồng đào tạo lái xe
                </a>
                @*<a href="@Url.Action("ExportWordThanhLyDong", "GPS_HocVien", new { id = Model.HV_MA, id1 = Model.HV_DVGTVT_MA, id2 = Model.STT_ORDER_KH })" class="btn btn-primary btn-sm">
                    <i class="fa fa-file-excel-o"></i> In thanh lý hợp đồng lái xe
                </a>*@
                &nbsp;&nbsp;
                <button class="btn btn-primary btn-sm" type="button" data-dismiss="modal">Hủy bỏ</button>
            </div>
        </div>
    </div>
}

<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>

<script src="~/Scripts/datepicker.js"></script>
<script src="~/Scripts/jquery-ui-1.11.4.js"></script>
<script src="~/Scripts/jquery.maskedinput.js"></script>
<script src="~/Scripts/jquery.maskMoney.js"></script>
<script src="~/Scripts/jquery.number.js"></script>
<script src="~/Scripts/jquery.masknumber.js"></script>
<script src="~/Scripts/moment.js"></script>

<script type="text/javascript">
    function ToJavaScriptDate(value) {
        if (value != null) {
            var pattern = /Date\(([^)]+)\)/;
            var results = pattern.exec(value);
            var dt = new Date(parseFloat(results[1]));
            return dt.getDate() + "/" + (dt.getMonth() + 1) + "/" + dt.getFullYear();
        }
        return null;
    }
</script>
<script type="text/javascript">
    $("#HV_NGAYSINH").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });

    $("#HV_NGAYCAPCMT").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });


    $("#HV_NGAYSINH").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });
    $("#HV_NGAYCAPCMT").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });

    // cho phep nhap so thap phan (su dung jquery.number)
    //$("#GV_THAMNIENLX").number(true, 2, '.', '');

</script>

@Styles.Render("~/Content/themes/base/css")

<script type="text/javascript">
    $(document).ready(function () {
        $("#HV_NOITT_DVHC_MA").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: "/GPS_HocVien/AutoCompleteHV_NOITT_DVHC_MA",
                    type: "POST",
                    dataType: "json",
                    data: { term: request.term },
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item.DVHC_TENDAYDU, value: item.DVHC_MA };
                        }))


                    }
                })
            },
            messages: {
                noResults: "", results: ""
            }
        });

        $("#HV_NOITT_DVHC_DVQL").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: "/GPS_HocVien/AutoCompleteHV_NOITT_DVHC_MA",
                    type: "POST",
                    dataType: "json",
                    data: { term: request.term },
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item.DVHC_TENDAYDU, value: item.DVHC_MA };
                        }))


                    }
                })
            },
            messages: {
                noResults: "", results: ""
            }
        });

        $("#HV_NOICT_DVHC_MA").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: "/GPS_HocVien/AutoCompleteHV_NOITT_DVHC_MA",
                    type: "POST",
                    dataType: "json",
                    data: { term: request.term },
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item.DVHC_TENDAYDU, value: item.DVHC_MA };
                        }))


                    }
                })
            },
            messages: {
                noResults: "", results: ""
            }
        });

        $("#HV_NOICT_DVHC_DVQL").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: "/GPS_HocVien/AutoCompleteHV_NOITT_DVHC_MA",
                    type: "POST",
                    dataType: "json",
                    data: { term: request.term },
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item.DVHC_TENDAYDU, value: item.DVHC_MA };
                        }))


                    }
                })
            },
            messages: {
                noResults: "", results: ""
            }
        });


        $("#HV_DVGTVT_MA").change(function () {
            $.ajax({
                url: '@Url.Action("getHV_MA", "GPS_HocVien")',
                type: 'post',
                data: {
                    gv_DVGTVT_MA: $('#HV_DVGTVT_MA').val()
                }
            }).done(function (response) {

                $('#HV_MA').val(response);
            });
        });
    })
</script>
